package Service;

import Dao.Impl.RentalRecordDAOImpl;
import pojo.RentalRecord;

import java.sql.SQLException;
import java.util.List;

public class CarRentalService {
    private RentalRecordDAOImpl rentalRecordDAOImpl;

    public CarRentalService() throws Exception {
        rentalRecordDAOImpl = new RentalRecordDAOImpl();
    }

    public List<RentalRecord> getAllRental() throws SQLException {
        return rentalRecordDAOImpl.getAllRental();
    }

    public void updatestatus(int quit_rentalid) throws SQLException {
        rentalRecordDAOImpl.updatestatus(quit_rentalid);
    }

    public List<RentalRecord> getRental_ByCarid(int searchText) throws SQLException {
        return rentalRecordDAOImpl.getRental_ByCarid(searchText);
    }
}
